package org.tlipoca.smarticlelike.client;

import org.genntii.smcommon.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("sm-article")
public interface ArticleClient {

    @GetMapping("/article/exists")
    Result<Boolean> articleExists(@RequestParam("articleId") Long articleId);

    @PostMapping("/article/like/{articleId}")
    Result articleLike(@RequestParam("like") int like, @RequestParam("dislike") int dislike, @PathVariable Long articleId);

    @GetMapping("/article/setLike")
    Result setLike(@RequestParam("like") Integer like,
                   @RequestParam("dislike") Integer dislike,
                   @RequestParam("articleId") Long articleId);
}
